using System.Text.Json.Nodes;
using SageKing.Designer.Core.Contracts;
using SageKing.Designer.Core.Models;

namespace SageKing.Designer.Core.Extensions;

/// <summary>
/// Contains extension methods for the <see cref="IActivityRegistry"/> interface.
/// </summary>
public static class ActivityRegistryExtensions
{
    /// <summary>
    /// Returns a list of activity descriptors that are browsable.
    /// </summary>
    public static IEnumerable<ActivityDescriptor> ListBrowsable(this IActivityRegistry activityRegistry) => 
        activityRegistry.List().Where(x => x.IsBrowsable).ToList();
}